<template>
    <div style="margin-top: 30px;">
        <span style="margin-top: 30px;">剩余水票为:</span>
        <span>{{ this.updateCustomerForm.custTicket }}</span>
    </div>
</template>


<script>
import { mapState } from 'vuex';
export default {
computed: {
  ...mapState(['user', 'token']),
},
data() {
  return {
    updateDialogFormVisible: true,
    name,
        // 修改客户表单
    updateCustomerForm: {
        id: '',
        custName: '',
        custAddress: '',
        custMobile: '',
        custTicket: '',
        account:'',
    }, 
    // account
  };
},
created() {
  console.log('User from Vuex Store:', this.user['userName']);
  this.name = this.user['userName'];
    this.preUpdateCustomer();
},
methods: {
    preUpdateCustomer() {
    console.log(this.name);
    this.$axios
    .get(`http://localhost:8091/customer/getName?name=${this.name}`)
    .then(resp => {
        let code = resp.data.code;
        if (code === 200) {
            this.updateCustomerForm = resp.data.data;
            console.log(this.updateCustomerForm);
        } else {
            this.$message.error("数据回显失败");
        }
    })
    .catch(err => {
        console.log("预修改客户请求发送失败 ", err);
        this.$message.error("预修改客户请求发送失败 ", err);
    });
    this.updateDialogFormVisible = true;
  },
}
}
</script>

<style lang="less" scoped>

</style>